package JVM.chapter04;

public class OperandStackTest {
    public static void main(String[] args) {
        byte i = 15;
        int j = 8;
        int k = i + j;

        int m = 127;

        OperandStackTest test = new OperandStackTest();
        test.add1();
        test.add2();
        test.add3();
        test.add4();
    }

    /******************************* 2 ********************************/
    /**
     * 查看 testGetNum() 的反编译文件
     * @return
     */
    public int getNum(){
        return 11;
    }

    public void testGetNum(){
        int i = getNum();
        int j = 10;
    }

    /******************************* 3 ********************************/
    /*
      i++ 和 ++i
     */
    public void add1(){
        //第 1 类问题
        int i1 = 10;
        i1++;
        System.out.println("i1 = " + i1);

        int i2 = 10;
        ++i2;
        System.out.println("i2 = " + i2);
    }

    public void add2(){
        // 第2类问题
        int i3 = 10;
        int i4 = i3++;
        System.out.println("i4 = " + i4);
        int i5 = 10;
        int i6 = ++i5;
        System.out.println("i6 = " + i6);
    }

    public void add3(){
        //第 3 类问题
        int i7 = 10;
        i7 = i7++;
        System.out.println("i7 = " + i7);
        int i8 = 10;
        i8 = ++i8;
        System.out.println("i8 = " + i8);
    }

    public void add4(){
        //第 4 类问题
        int i9 = 10;
        int i10 = i9++ + ++i9;
        System.out.println("i10 = " + i10);
    }

}
